package org.dingyom.user.rabbitMQ.handler;

import com.rabbitmq.client.Channel;
import org.dingyom.basics.util.SmsUtil;
import org.dingyom.user.config.RegisterNoticeRabbitmqConfig;
import org.dingyom.user.dto.RegisterNoticeDto;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * rabbitmq 用户 接收手机短信的消息队列 进行处理
 */
@Component
public class RegisterNoticeSmsReceiveHandler {
    //监听email队列
    @RabbitListener(queues = {RegisterNoticeRabbitmqConfig.QUEUE_INFORM_SMS})
    public void receive_email(RegisterNoticeDto registerNoticeDto, Message message, Channel channel) {
        System.out.println(registerNoticeDto.getReceiver());
        System.out.println(registerNoticeDto.getContent());

        //使用短信技术进行发送
//        SmsUtil.sendSms(registerNoticeDto.getReceiver(),registerNoticeDto.getContent());
    }
}